home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 September / macformat-004.iso / Shareware City / Graphics / VideoToolbox ƒ / VideoToolboxSources / SetMouse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-07  |  1.6 KB  |  50 lines  |  [TEXT/KAHL]

  1. /*
  2. SetMouse.c
  3.  
  4. Sets the mouse location to the given point, which is specified in the local
  5. coordinate system of the current port.
  6.  
  7. WARNING: In the Q & A Stack, Apple tells you how to do this, but warns that the
  8. technique uses undocumented low-memory locations that are considered unsupported
  9. and volatile and may change in future CPUs.
  10.  
  11. THIS IS PROBABLY INCOMPATIBLE WITH THE POWER PC!!!
  12.  
  13. From "Code gadgets: Setting the mouse location", THINKin' CaP, 1(2):28-29, Fall 1990.
  14.  
  15. Copyright © 1991 SPLAsh Resources. All rights reserved. This source code is
  16. copyrighted, but free. This means that programmers may use the code and
  17. incorporate it into their own programs (commercial or otherwise) without payment
  18. of any fees. However, the source code itself may not be sold or distributed on
  19. electronic bulletin board services without written permission from SPLAsh
  20. Resources.
  21.  
  22. SPLAsh Resources
  23. 1678 Shattuck Ave #302
  24. Berkeley, CA  94709
  25. (415) 527-0122
  26.  
  27. HISTORY:
  28. 2/25/91 dgp added to VideoToolbox
  29. 8/24/91    dgp    Made compatible with THINK C 5.0.
  30. 5/28/94 dgp Eliminated use of SysEqu.h, for compatibility with Apple's Universal Headers.
  31. */
  32. #include "VideoToolbox.h"
  33.  
  34. Point    MTemp        :    0x828;        /* Low memory globals */
  35. Point    RawMouse    :    0x82C;
  36. Byte    CrsrNew        :    0x8CE;
  37. Byte    CrsrCouple    :    0x8CF;
  38.  
  39. void SetMouse(Point    where)
  40. {
  41.     LocalToGlobal(&where);        /* Convert point to global coordinates    */
  42.     
  43.     /* Quoting from the Q & A Stack: "If you wish to place the cursor in an    */
  44.     /* absolute location on the screen, you must set RawMouse, and MTemp to    */
  45.     /* the same value, and set CrsrNew to the same value as CrsrCouple."    */
  46.         
  47.     MTemp=RawMouse=where;
  48.     CrsrNew=CrsrCouple;
  49. }
  50.